#include "AngryBot.h"



AngryBot::AngryBot( Vec3D& position, Player *player, int aggreRange )
	:mPlayer(player),
	mAggressionRange(aggreRange)
{
	xPositionEntity(mesh, position.x, position.y, position.z);
	xEntityColor(mesh, 255,0,0);
}



void AngryBot::Update()
{
	if (!IsDead())
	{
		if (DistanceTo(mPlayer->GetPosition()) < mAggressionRange)
		{
			SetDestination(mPlayer->GetPosition());
			if (InPosition(mPlayer->GetPosition()))
			{
				DealDamage(mPlayer);
			}
		}
		Bot::Update();
	}
}


